﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using DTO;
using DAO;

namespace BUS
{
    public class TaiKhoan_BUS
    {
        // load danh sach tat ca tai khoan
        public static DataTable LoadDSTaiKhoan()
        {
            return DAO.TaiKhoan_DAO.loadDSTatCaTaiKhoan();
        }
        // them tai khoan moi
        public static void themTaiKhoan(TaiKhoan_DTO TaiKhoan)
        {
            TaiKhoan_DAO.themTaiKhoanMoi(TaiKhoan);
        }
        // chinh sua thong tin tai khoan
        public static void suaThongTinTK(TaiKhoan_DTO taikhoan)
        {
            TaiKhoan_DAO.suaThongTinTaiKhoan(taikhoan);
        }
        // doi mat khau tai khoan
        public static void doiMatKhauTK(string userId, string password)
        {
            TaiKhoan_DAO.doiMatKhauTaiKhoan(userId, password);
        }
        // xoa tai khoan
        public static void xoaTaiKhoan(string matk)
        {
            TaiKhoan_DAO.xoaMotTaiKhoan(matk);
        }
        // lay thong tin mot sinh vien
        public static DataTable layThongTinTK(string matk)
        {
            return TaiKhoan_DAO.layThongTinTaiKhoan(matk);
        }
        // kiem tra ma tai khoan da co nguoi dung chua
        public static bool kiemTraMaTaiKhoan(string matk)
        {
            return TaiKhoan_DAO.kiemTraMaTK(matk);
        }
        public static bool kiemTraTenTaiKhoan(string tentk)
        {
            return TaiKhoan_DAO.kiemTraMaTK(tentk);
        }
    }
}
